<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>充值卡页面</title>
    <base th:href="@{http://localhost:9090/}"/>
    <script th:src="@{js/jquery-3.2.1.min.js}"></script>
    <script th:src="@{js/rechargeablecard.js}"></script>
    <script type="text/javascript">
        var countdown = function(timeout) {
            var countUI = document.getElementById("count");
            if(!!countUI) {
                countUI.innerHTML = timeout;
                if (timeout == 0) {
                    alert("充值失败");
                    window.close();
                }
                else {
                    timeout--;
                    setTimeout(function(){
                        countdown(timeout)
                    }, 1000);
                }
            }
        }

        function init(){
            countdown(5);
        }
    </script>
</head>
<body onload=init();>
<div>
    <span>倒计时:</span>
    <span id="count">5</span>
    <span>秒</span>
</div>
<div style="text-align: center;margin: auto">
  <h4 th:text="当前操作+'：'+充值就诊卡+'。'+请输入充值金额后点+'确定'+按钮" style="margin-top: 100px"></h4>
  <form th:action="@{buydrug/rechargeablemoney(balance=${balance})}" method="post">
    <p>
      <label th:text="充值卡号+'：'"></label>
      <input type="text" th:value="${pCard}"/>
    </p>
    <p>
      <label th:text="充值金额+'：'"></label>
      <input type="text" th:name="rechargeablemoney" id="rechargeablemoney"/>
    </p>
    <p>
      <input type="submit" th:value="确定"/>
      <input type="button" id="back" th:value="取消">
    </p>
      <input type="hidden" th:value="${info}" id="message">
  </form>

</div>
</body>
</html>